// Copyright (C) 2019 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**************************\
  Basic Modal Styles
\**************************/
.modal {
  font-family: 'Raleway', sans-serif;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.modal-container {
  background-color: #fff;
  padding: 30px;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 4px;
  overflow-y: auto;
  box-sizing: border-box;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  margin-top: 0;
  margin-bottom: 0;
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.25;
  color: #262f3c;
  box-sizing: border-box;
}

.modal-close {
  background: transparent;
  border: 0;
}

.modal-header .modal-close:before { content: "\2715"; }

.modal-content {
  margin-top: 2rem;
  margin-bottom: 2rem;
  line-height: 1.5;
  color: rgba(0,0,0,.8);
}

.modal-btn {
  font-size: .875rem;
  padding-left: 1rem;
  padding-right: 1rem;
  padding-top: .5rem;
  padding-bottom: .5rem;
  background-color: #e6e6e6;
  color: rgba(0,0,0,.8);
  border-radius: .25rem;
  border-style: none;
  border-width: 0;
  cursor: pointer;
  -webkit-appearance: button;
  text-transform: none;
  overflow: visible;
  line-height: 1.15;
  margin: 5px;
  will-change: transform;
  -moz-osx-font-smoothing: grayscale;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  transition: -webkit-transform .25s ease-out;
  transition: transform .25s ease-out;
  transition: transform .25s ease-out,-webkit-transform .25s ease-out;
}

.modal-btn:focus, .modal-btn:hover {
  -webkit-transform: scale(1.05);
  transform: scale(1.05);
}

.modal-btn-primary {
  background-color: #262f3c;
  color: #fff;
}

.modal-footer {
  display: flex;
  justify-content: space-around;
}

/**************************\
  Demo Animation Style
\**************************/
@keyframes mmfadeIn {
    from { opacity: 0; }
      to { opacity: 1; }
}

@keyframes mmfadeOut {
    from { opacity: 1; }
      to { opacity: 0; }
}

@keyframes mmslideIn {
  from { transform: translateY(15%); }
    to { transform: translateY(0); }
}

@keyframes mmslideOut {
    from { transform: translateY(0); }
    to { transform: translateY(-10%); }
}

.micromodal-slide {
  display: none;
}

.micromodal-slide.is-open {
  display: block;
}

.micromodal-slide[aria-hidden="false"] .modal-overlay {
  animation: mmfadeIn .3s cubic-bezier(0.0, 0.0, 0.2, 1);
}

.micromodal-slide[aria-hidden="false"] .modal-container {
  animation: mmslideIn .3s cubic-bezier(0, 0, .2, 1);
}

.micromodal-slide[aria-hidden="true"] .modal-overlay {
  animation: mmfadeOut .3s cubic-bezier(0.0, 0.0, 0.2, 1);
}

.micromodal-slide[aria-hidden="true"] .modal-container {
  animation: mmslideOut .3s cubic-bezier(0, 0, .2, 1);
}

.micromodal-slide .modal-container,
.micromodal-slide .modal-overlay {
  will-change: transform;
}

.help {
  table {
    margin-bottom: 15px;
    td {
      min-width: 250px;
    }
    td:first-child {
      font-family: var(--monospace-font);
    }
  }
  h2 {
    font: inherit;
    font-weight: bold;
  }
}

.modal-pre {
  white-space: pre-line;
  font-size: 13px;
  user-select: text;
}

.modal-logs, .modal-bash {
  white-space: pre-wrap;
  border: 1px solid #999;
  background: #eee;
  font-size: 10px;
  font-family: monospace;
  -webkit-user-select: text;
  margin-top: 10px;
  margin-bottom: 10px;
  min-height: 50px;
  max-height: 40vh;
  overflow: scroll;
}

.modal-bash {
  margin: 0;
  padding: 5px 0;
  overflow: auto;
  min-height: 0;
}

.modal-textarea {
  display: block;
  margin-top: 10px;
  margin-bottom: 10px;
  width: 100%;
}

.modal-small {
  font-size: 11px;
}
